import request from '@/utils/request'

// 获取数据列表
export function fetchList(query) {
  return request({
    url: '/store/commodity/list',
    method: 'post',
    data: query
  })
}

// 新增
export function add(item) {
  return request({
    url: '/store/commodity/add',
    method: 'post',
    data: item
  })
}

// 修改
export function update(item) {
  return request({
    url: '/store/commodity/update',
    method: 'post',
    data: item
  })
}

// 删除
export function del(item) {
  return request({
    url: '/store/commodity/delete',
    method: 'post',
    data: { id: item }
  })
}

// 模糊查询
export function fuzzyQuery(value) {
  return request({
    url: '/store/commodity/fuzzyQuery/' + value + '?d' + new Date().getTime(),
    method: 'get'
  })
}

// 获取数据列表
export function findByObject(query) {
  return request({
    url: '/store/commodity/findByObject',
    method: 'post',
    data: query
  })
}
